/**
 * 
 */
package org.o14x.alpha.ui.commands;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.o14x.alpha.ui.controller.UIController;

/**
 * Refresh display command.
 * 
 * @author Olivier DANGREAUX
 */
public class RefreshCommand extends AbstractHandler {
	/**
	 * UIController
	 */
	private UIController uiController;

	/* (non-Javadoc)
	 * @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
	 */
	@Override
	public Object execute(ExecutionEvent event) throws ExecutionException {
		// update folderView
		uiController.getDomain().getCurrentExplorerTab().getFolderView().update();

		// update folderTreeView
		uiController.getUi().getFolderTreeView().update();

		return null;
	}

	/**
	 * Returns the value of uiController.
	 *
	 * @return The value of uiController.
	 */
	public UIController getUiController() {
		return uiController;
	}

	/**
	 * Sets the value of uiController.
	 *
	 * @param uiController The value of uiController to set.
	 */
	public void setUiController(UIController uiController) {
		this.uiController = uiController;
	}

}
